package com.flink.streaming.web.adapter;

import com.flink.streaming.web.enums.DeployModeEnum;
import com.flink.streaming.web.model.flink.JobStandaloneInfo;
import com.flink.streaming.web.model.flink.JobYarnInfo;

public interface FlinkHttpRequestAdapter {

    /**
     * per yarn 模式下获取任务新状态
     */
    JobYarnInfo getJobInfoForPerYarnByAppId(String appId);


    /**
     * Standalone 模式下获取状态
     */
    JobStandaloneInfo getJobInfoForStandaloneByAppId(String appId, DeployModeEnum deployModeEnum);


    /**
     * per yarn 模式下 取消任务
     */
    void cancelJobForYarnByAppId(String appId, String jobId);


    /**
     * 基于flink rest API取消任务
     */
    void cancelJobForFlinkByAppId(String jobId, DeployModeEnum deployModeEnum);


    /**
     * per yarn 模式下 获取SavepointPath 地址
     * <p>
     * 通过checkpoint 接口获取Savepoint地址
     */
    String getSavepointPath(String appId, String jobId);


}
